package Collection;

import demo1.Student;
import demo1.Student1;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Objects;

public class CollectionToArray {
    public static void main(String[] args) {
        Collection arr = new ArrayList();
        arr.add(new Student1("张三", 18));
        arr.add(new Student1("李四", 18));
        arr.add(new Student1("王二麻", 18));
        arr.add(new Student1("周五", 18));
        arr.add(new Student1("钱六", 18));
        System.out.println(arr);
        Object[] objarr = arr.toArray();
        for (int i = 0; i < objarr.length; i++) {
            System.out.println(objarr[i]);
        }
    }
}
